home *** CD-ROM | disk | FTP | other *** search
/ Sounds Terrific 1 / Sounds Terrific CD (1994)(Weird Science)(Disc 2 of 2)[!][Amiga-PC].iso / modules / f / fixnetld.mod < prev    next >
Encoding:
Text File  |  1994-08-04  |  2.4 KB  |  51 lines

  1. Fix Reload of Network Files              (FIXNETLD.MOD)
  2. Goose #1 @17310
  3. Saturday, December 28, 1991   8:35 pm
  4.                           Fix Reload for Network Files           (FIXNETLD.MOD)
  5.                           by Goose, 1@17310 (WWIVlink)
  6.  
  7. This mod fixes a minor bug in the WWIV source code for v4.20.  I'm not sure if
  8. the bug is present in older versions, but I'm sure someone will attempt to
  9. install it and find out.  This is one I found when installing Jim Wire's
  10. SWITCH mod to run Dual Networks -- everytime the board switched from one
  11. network to the other, it would lose a little memory.  After figuring out it
  12. wasn't A) an error in my installation of the mod, or B) an error in the mod
  13. itself, I traced through the code to the point where I found a variable
  14. getting allocated, but never release before being reallocated.  What this
  15. basically meant is that a little bit of memory would be lost whenever
  16. //SWITCHing from one system to another, //RELOADing the menus, or receiving a
  17. network update and running NETWORK3 without shrinking out.  I guess the bug
  18. was obscure enough though that it was never found, at least until now.
  19. Since the default for the board is to shrink for NETWORK3, and most sysops
  20. don't use //RELOAD that often, this mod won't be too noticable unless you
  21. have the switch mod in (or another mod that re-reads the network files).
  22.  
  23. For the change, go into SYSOPF.C, void read_new_stuff(), and add the three
  24. lines shown to reinitialize the csn_index variable:
  25.  
  26.   if (con!=NULL)
  27.     farfree(con);
  28.   if (csn_index!=NULL)                                     /* mod - add */
  29.     farfree(csn_index);                                    /* mod - add */
  30.   ncn=NULL;
  31.   cnn=NULL;
  32.   csn=NULL;
  33.   con=NULL;
  34.   csn_index=NULL;                                          /* mod - add */
  35.   read_in_file("MENUS.MSG",(menus),30);
  36.  
  37. Then in NETSUP.C, make similar changes in int check_bbsdata (NOTE that this
  38. function actually appears in the code twice.  Make sure you make the same
  39. change in both places!!!):
  40.  
  41.     if (con!=NULL)
  42.       farfree(con);
  43.     if (csn_index!=NULL)                                   /* mod - add */
  44.       farfree(csn_index);                                  /* mod - add */
  45.     read_bbs_list_index();
  46.     read_contacts();
  47.  
  48. Recompile the two files and you're all set -- no more dissappearing memory,
  49. at least not due to this bug.
  50. 9
  51. 9 1The Twilight Zone 6≡2 703-369-5225 6≡5 14.4K USR DS 6≡3 WWIV Support0